package com.aiyige.page.filter.adapter;

import android.view.View;
import android.widget.TextView;

import com.aiyige.R;
import com.aiyige.model.commontag.CommonTag;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.LinkedList;

import butterknife.BindView;
import butterknife.ButterKnife;

public class BigGridFilterGroupAdapter extends BaseQuickAdapter<CommonTag, BigGridFilterGroupAdapter.VH> {

    public BigGridFilterGroupAdapter() {
        super(R.layout.big_filter, new LinkedList<CommonTag>());
    }

    @Override
    protected void convert(VH helper, CommonTag item) {
        helper.bindData(item);
    }


    public class VH extends BaseViewHolder {
        @BindView(R.id.titleTv)
        TextView titleTv;
        CommonTag data;

        public VH(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

        public void bindData(CommonTag tag) {
            data = tag;
            titleTv.setSelected(data.isSelected());
            titleTv.setText(data.getTitle());
        }
    }

}
